namespace IMPlant.Core.Configuration
{
    using IMPlant.Core.Common.Enum;
    using System;
    using System.Collections;
    using System.Configuration;

    public class ConfigerHandler
    {
        public static string GetConfig(SurportsType surportsType, string surportName, KeyType keyType)
        {
            string s = ConfigurationManager.GetSection("PlanConfig").ToString();
            Hashtable section = ConfigurationManager.GetSection("PlanConfig") as Hashtable;
            if (!section.ContainsKey(surportsType.ToString()))
            {
                throw new Exception("thers is no Surports:" + surportsType.ToString());
            }
            Hashtable hashtable2 = section[surportsType.ToString()] as Hashtable;
            if (!hashtable2.ContainsKey(surportName))
            {
                throw new Exception("the Surports " + surportsType.ToString() + " there is no names:" + surportName);
            }
            Hashtable hashtable3 = hashtable2[surportName] as Hashtable;
            if (!hashtable3.ContainsKey(keyType.ToString()))
            {
                throw new Exception("the Surports " + surportsType.ToString() + " the Surport " + surportName + " there is no key:" + keyType.ToString());
            }
            return hashtable3[keyType.ToString()].ToString();
        }
    }
}

